package components.base
{
	import flash.display.DisplayObject;
	
	import mx.containers.ViewStack;
	import mx.core.IVisualElement;
	import mx.core.UIComponent;
	
	import utils.ContainerUtil;
	
	public class BaseViewStack extends ViewStack
	{
		public function BaseViewStack()
		{
			super();
		}
		
		override public function removeChild(item:DisplayObject):DisplayObject
		{
			ContainerUtil.diposeAll(item as UIComponent);
			return super.removeChild(item);
		}
		
		override public function removeElement(element:IVisualElement):IVisualElement
		{
			ContainerUtil.diposeAll(element as UIComponent);
			return super.removeElement(element);
		}
	}
}